package com.songcy.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


public class AddCardServlet extends HttpServlet {

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	/**
	 * The doGet method of the servlet. <br>
	 *
	 * This method is called when a form has its tag value method equals to get.
	 * 
	 * @param request the request send by the client to the server
	 * @param response the response send by the server to the client
	 * @throws ServletException if an error occurred
	 * @throws IOException if an error occurred
	 */
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		this.doPost(request, response);
	}

	/**
	 * The doPost method of the servlet. <br>
	 *
	 * This method is called when a form has its tag value method equals to post.
	 * 
	 * @param request the request send by the client to the server
	 * @param response the response send by the server to the client
	 * @throws ServletException if an error occurred
	 * @throws IOException if an error occurred
	 */
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {


		response.setContentType("text/html;charset=UTF-8");
		request.setCharacterEncoding("UTF-8");
		PrintWriter out = response.getWriter();
		
		
		String txtComJNam=request.getParameter("txtComJNam");
		String txtComJNampy=request.getParameter("txtComJNampy");
		String txtComJNameng=request.getParameter("txtComJNameng");
		String txtComunit=request.getParameter("txtComunit");
		String txtComcaree=request.getParameter("txtComcaree");
		String txtComname=request.getParameter("txtComname");
		String txtComnamepy=request.getParameter("txtComnamepy");
		String txtCommycard=request.getParameter("txtCommycard");
		
		
		String zip1=request.getParameter("zip1");
		String zipprovince1=request.getParameter("zipprovince1");
		String zipcity1=request.getParameter("zipcity1");
		String zipzone1=request.getParameter("zipzone1");
		String zipaddress1=request.getParameter("zipaddress1");
		String zipphone1=request.getParameter("zipphone1");
		String zipphone2=request.getParameter("zipphone2");
		String zipmobile1=request.getParameter("zipmobile1");
		String zipfax1=request.getParameter("zipfax1");
		String zipemail1=request.getParameter("zipemail1");
		String zipurl1=request.getParameter("zipurl1");
		
		
		String zip2=request.getParameter("zip2");
		String zipprovince2=request.getParameter("zipprovince2");
		String zipcity2=request.getParameter("zipcity2");
		String zipzone2=request.getParameter("zipzone2");
		String zipaddress2=request.getParameter("zipaddress2");
		String ziptelphone1=request.getParameter("ziptelphone1");
		String ziptelphone2=request.getParameter("ziptelphone2");
		String zipmobile2=request.getParameter("zipmobile2");
		String zipfax2=request.getParameter("zipfax2");
		String zipemail2=request.getParameter("zipemail2");
		String zipurl2=request.getParameter("zipurl2");
		
		
		String ddlstPublic=request.getParameter("ddlstPublic");
		String ddlstImptantKub=request.getParameter("ddlstImptantKub");
		String ddlstRelationKub=request.getParameter("ddlstRelationKub");
		String ddlstJobKub=request.getParameter("ddlstJobKub");
		
		
		String ddlstSexKub=request.getParameter("ddlstSexKub");
		String ddlstBlodKub=request.getParameter("ddlstBlodKub");
		String birthday=request.getParameter("birthday");
		String txtMemo=request.getParameter("txtMemo");
		
		
		String industry=request.getParameter("industry");
		String establish=request.getParameter("establish");
		String funding=request.getParameter("funding");
		String staff=request.getParameter("staff");
		String security=request.getParameter("security");
		String corporate=request.getParameter("corporate");

		
		
		
		request.setAttribute("txtComJNam", txtComJNam);
		request.setAttribute("txtComJNampy", txtComJNampy);
		request.setAttribute("txtComJNameng", txtComJNameng);
		request.setAttribute("txtComunit", txtComunit);
		request.setAttribute("txtComcaree", txtComcaree);
		request.setAttribute("txtComname", txtComname);
		request.setAttribute("txtComnamepy", txtComnamepy);
		request.setAttribute("txtCommycard", txtCommycard);
		
		
		request.setAttribute("zip1", zip1);
		request.setAttribute("zipprovince1", zipprovince1);
		request.setAttribute("zipcity1", zipcity1);
		request.setAttribute("zipzone1", zipzone1);
		request.setAttribute("zipaddress1", zipaddress1);
		request.setAttribute("zipphone1", zipphone1);
		request.setAttribute("zipphone2", zipphone2);
		request.setAttribute("zipmobile1", zipmobile1);
		request.setAttribute("zipfax1", zipfax1);
		request.setAttribute("zipemail1", zipemail1);
		request.setAttribute("zipurl1", zipurl1);
		
		
		request.setAttribute("zip2", zip2);
		request.setAttribute("zipprovince2", zipprovince2);
		request.setAttribute("zipcity2", zipcity2);
		request.setAttribute("zipzone2", zipzone2);
		request.setAttribute("zipaddress2", zipaddress2);
		request.setAttribute("ziptelphone1", ziptelphone1);
		request.setAttribute("ziptelphone2", ziptelphone2);
		request.setAttribute("zipmobile2", zipmobile2);
		request.setAttribute("zipfax2", zipfax2);
		request.setAttribute("zipemail2", zipemail2);
		request.setAttribute("zipurl2", zipurl2);
		
		
		request.setAttribute("ddlstPublic", ddlstPublic);
		request.setAttribute("ddlstImptantKub", ddlstImptantKub);
		request.setAttribute("ddlstRelationKub", ddlstRelationKub);
		request.setAttribute("ddlstJobKub", ddlstJobKub);
		request.setAttribute("ddlstSexKub", ddlstSexKub);
		request.setAttribute("ddlstBlodKub", ddlstBlodKub);
		request.setAttribute("birthday", birthday);
		request.setAttribute("txtMemo", txtMemo);
		request.setAttribute("industry", industry);
		request.setAttribute("establish", establish);
		request.setAttribute("funding", funding);
		request.setAttribute("staff", staff);
		request.setAttribute("security", security);
		request.setAttribute("corporate", corporate);


		
		RequestDispatcher dispatcher=request.getRequestDispatcher("test.jsp");
		dispatcher.forward(request, response);
		
	}

	/**
	 * Initialization of the servlet. <br>
	 *
	 * @throws ServletException if an error occurs
	 */
	public void init() throws ServletException {
		// Put your code here
	}

}
